package com.bdqn.ch06;


import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import redis.clients.jedis.Jedis;

@RunWith(SpringRunner.class)
@SpringBootTest
public class JedisTester {

    private Jedis jedis;

    @Before
    public void setup() {
        //连接 redis 服务器，127.0.0.1:6379
        jedis = new Jedis("127.0.0.1", 6379, 5000);
        //权限认证，指定密码
        //jedis.auth("foobared");
        System.out.println("setup");
    }

    @Test
    public void setStringTester() {
        System.out.println("setStringTester");
        jedis.set("name", "huanghuang");
    }
}
